package com.chen.gulimallcommon.common.exception;

//异常状态码的返回值，用枚举类型包装
public enum  ExceptionCodeEnum {

    //表示将此为一个构造函数
    UNKKNOW_EXCEPTION(10000,"系统未知异常"),
    VAILD_EXCEPTION(10001,"系统参数效验错误"),
    PRODUCT_UP_EXCEPTION(11000,"商品上架异常"),
    SMS_CODE_EXCEPTION(10002,"验证码获取频率太高，请稍后在试"),
    TO_MANY_REQUEST(10003,"请求流量过大，请稍后再试"),
    USERNAME_EXIST_EXCEPTION(15001,"用户存在异常"),
    PHONE_EXIST_EXCEPTION(15002,"手机号码存在异常"),
    NO_STOCK_EXCEPTION(21000,"商品库存不足"),
    USER_NOEXIST_EXCEPTION(15003,"用户不存在或者密码错误");

    private int code;
    private String message;

    ExceptionCodeEnum(int code,String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
